﻿
import type { IFileAttachment, ISysOrg, ISysGroup, ISysJobPosition } from '@/type/fileattachment'

export interface ISysHrInterviewRequestBill {
  RecruitPoolId: string | null;
  RecruitNo: string | null;
  ID?: string | null;
  ArrivalDate: Date | null;
  CurrentSalary: string | null;
  ExpectedSalary: string | null;
  WorkExperience: string | null;
  InitialTestTime: Date | null;
  InitialResult: string | null;
  InitialComment: string | null;
  ReExamTime: Date | null;
  ReExamResult: string | null;
  ReExamComment: string | null;
  FinalResult: string | null;
  FinalRemark: string | null;
  RejectReason: string | null;
  BillCode: string | null;
  BillStatus: number | null | string;
  WorkflowStatus: number | null | string;
  Remark: string | null;
  Approver: string | null;
  ApprovalTime: Date | null;
  Name: string | null;
  StaffNo: string | null;
  BirthDate: Date | null;
  Age: number | null;
  Gender: number | null;
  Ethnicity: number | null;
  HighestEducation: number | null;
  MaritalStatus: number | null;
  PhotoId: string | null;
  Photo?: IFileAttachment;
  IdCardNo: string | null;
  IdCardFrontPhotoId: string | null;
  IdCardFrontPhoto?: IFileAttachment;
  IdCardBackPhotoId: string | null;
  IdCardBackPhoto?: IFileAttachment;
  IdCardExpiryDate: Date | null | string;
  HouseholdRegistration: string | null;
  NativePlace: string | null;
  PoliticalStatus: number | null;
  PartyJoinDate: Date | null;
  PartyBranch: string | null;
  ArchiveLocation: string | null;
  ArchiveNo: string | null;
  ArchiveTransferOutDate: Date | null;
  ArchiveTransferInDate: Date | null;
  HomeAddress: string | null;
  Phone: string | null;
  Email: string | null;
  SalaryBank: string | null;
  SalaryAccount: string | null;
  BonusBank: string | null;
  BonusAccount: string | null;
  OrgId: string | null;
  Org?: ISysOrg;
  GroupId: string | null;
  Group?: ISysGroup;
  JobPositionId: string | null;
  JobPosition?: ISysJobPosition;
  ResumeId: string | null;
  Resume?: IFileAttachment;
  HireDate: Date | null;
  ConfirmationDate: Date | null;
  EmploymentType: number | null;
  ContractType: number | null;
  ContractNo: string | null;
  ContractStartDate: Date | null;
  ContractEndDate: Date | null;
  ResignationDate: Date | null;
  ResignationReason: string | null;
  ResignationType: number | null;
  State: number | null;
  BloodType: number | null;
  Hobbies: string | null;
  IsVeteran: string | null;
  VeteranCertificateId: null | string;
  VeteranCertificate?: IFileAttachment;
  WorkYears: number | null;
  CompanyYears: number | null;
  JoinWorkDate: Date | null;
  ArchiveAgeDate: Date | null;
  Order: number | null;
  RecruitPublishRequestBillId: string | null;
}

export interface ISysHrInterviewRequestBillVm {
  Entity: ISysHrInterviewRequestBill;
  ActionName: string | null;
  IsMyApprove: boolean;
  Remark: string | null;
}

export interface ISysHrInterviewRequestBillView extends ISysHrInterviewRequestBill {

  ActionNames?: string;

}

export interface ISysHrInterviewRequestBillQuery {
  BillCode?: string
  BillStatus?: number
  WorkflowStatus?: number
  Approver?: string
  ApprovalTime?: Date
  Name?: string
  StaffNo?: string
  Ethnicity?: number
  MaritalStatus?: number
  Phone?: string
  OrgId?: string
  JobPositionId?: string
  EmploymentType?: number
  State?: number
  Limit?: number
  Page?: number
}

// 身份证识别相关接口
export interface IRecognizeIdentityCardRequest {
  ImageId: string; // 图片ID
  CardType: string; // 证件类型 front（正面）、back（反面），默认为front
}

// 身份证识别返回结果
export interface IRecognizeIdentityCardResponse {
  Data: {
    Name?: string; // 姓名
    Gender?: string; // 性别
    Nationality?: string; // 民族
    BirthDate?: string; // 出生日期
    Address?: string; // 地址
    IdNumber?: string; // 身份证号码
    IssuingAuthority?: string; // 签发机关
    ValidPeriod?: string; // 有效期
    IdCardExpiryDate?: string; // 身份证有效期
    Message?: string; // 响应消息
  };
  Code: number; // 状态码
  Message: string; // 响应消息
}

// 招聘发布单搜索请求参数接口
export interface IRecruitPublishRequestBillSearchQuery {
  IsExternalPublish?: boolean; // 是否外部发布
}

// 招聘发布单信息接口
export interface IRecruitPublishRequestBill {
  ID: string;
  BillCode: string;                    // 单据编号
  Title: string;                       // 岗位标题
  GroupName: string;                   // 部门名称
  OrgName: string;                     // 公司名称
  HireNumber: number;                  // 招聘人数
  SalaryRange: string;                 // 薪资范围
  AgeRequirement: string;              // 年龄要求
  EducationRequirement: string;        // 学历要求
  GenderRequirement: string;           // 性别要求
  MajorRequirement: string;            // 专业要求
  JobRequirement: string;              // 岗位要求
  OtherRequirement: string;            // 其他要求
  Benefits: string;                    // 福利待遇
  Description: string;                 // 岗位描述
  ExpectedDate: string;                // 期望到岗日期
  IsExternalPublish: boolean;          // 是否外部发布
  BillStatus: string;                  // 单据状态
  WorkflowStatus: string;              // 工作流状态
  Approver: string;                    // 审批人
  ApprovalTime: string;                // 审批时间
  CreateTime: string;                  // 创建时间
  Remark: string;                      // 备注
  CanApprove: boolean;                 // 是否可审批
}

// 招聘发布单搜索响应接口
export interface IRecruitPublishRequestBillSearchResponse {
  Code: number;
  Data: IRecruitPublishRequestBill[];
  Msg: string;
  Count?: number;
  PageCount?: number;
  Page?: number;
}

// ===== 子表相关接口定义 =====

// 子表搜索请求通用接口
export interface ISubTableSearchRequest {
  Limit: number;
  Page: number;
  PersonId: string;
  SortInfo?: any;
}

// 学习经历相关接口
export interface IEducationResponse {
  ID: string;
  PersonId: string;
  School: string;
  Major: string;
  EducationLevel: string;
  EnrollmentDate: string;
  GraduationDate?: string;
  EducationSystem?: string;
  SelectedEducationFilesIds?: string | { FileId: string }[];
}

export interface IEducationRequest {
  Entity: {
    PersonId: string;
    School: string;
    Major: string;
    EducationLevel: string;
    EnrollmentDate: string;
    GraduationDate?: string;
    EducationSystem?: string;
  };
  SelectedEducationFilesIds?: { FileId: string }[];
}

// 家庭成员相关接口
export interface IFamilyResponse {
  ID: string;
  PersonId: string;
  MemberName: string;
  RelationshipType: string;
  BirthDate?: string;
  Ethnicity?: string;
  ContactPhone?: string;
  WorkOrSchool?: string;
  JobOrGrade?: string;
}

export interface IFamilyRequest {
  Entity: {
    PersonId: string;
    MemberName: string;
    RelationshipType: string;
    BirthDate?: string;
    Ethnicity?: string;
    ContactPhone?: string;
    WorkOrSchool?: string;
    JobOrGrade?: string;
  };
}

// 工作经历相关接口
export interface IWorkResponse {
  ID: string;
  PersonId: string;
  Company: string;
  Position: string;
  StartDate: string;
  EndDate?: string;
  Reference?: string;
}

export interface IWorkRequest {
  Entity: {
    PersonId: string;
    Company: string;
    Position: string;
    StartDate: string;
    EndDate?: string;
    Reference?: string;
  };
}

// 荣誉职称相关接口
export interface IHonorResponse {
  ID: string;
  PersonId: string;
  QualificationName?: string;
  TitleName?: string;
  ProfessionalTitleTypeName?: string;
  QualificationLevel?: string;
  IssuingAuthority?: string;
  CertificateCode?: string;
  ObtainedDate?: string;
  ExpiryDate?: string;
  SalaryReward?: string;
  Remark?: string;
  TitleDocument?: IFileAttachment;
  CertificateDocumentId?: string;
}

export interface IHonorRequest {
  Entity: {
    PersonId: string;
    TitleName?: string;
    QualificationName?: string;
    ProfessionalTitleTypeId?: string;
    QualificationLevel?: string;
    IssuingAuthority?: string;
    CertificateCode?: string;
    ObtainedDate?: Date;
    ExpiryDate?: Date;
    SalaryReward?: string;
    Remark?: string;
    TitleDocumentId?: string;
    CertificateDocumentId?: string;
    ProfessionalTitleTypeName?: string;
  };
  ActionName?: string;
  IsMyApprove?: boolean;
}

// 人像验证接口类型
export interface IValidatePortraitRequest {
  ImageId: string; // 图片ID（GUID格式），必填
}

export interface IValidatePortraitResponse {
  Code: number;    // 状态码，200表示成功
  Message: string; // 返回消息
  Data: string | null; // 返回数据
}
